﻿using System;
using System.Threading;
using System.Windows.Browser;

using RaisingStudio.SmallProgram.Library.Internal;

namespace RaisingStudio.SmallProgram.Library
{
    [SmallProgramType]
    public static class Program
    {
        public static void Delay(Primitive milliSeconds)
        {
            Thread.Sleep(TimeSpan.FromMilliseconds((double)milliSeconds));
        }

        public static void End()
        {
        }

        public static Primitive Directory
        {
            get
            {
                return (string)SmallProgramApplication.InvokeWithReturn(delegate
                {
                    return HtmlPage.Document.DocumentUri.AbsoluteUri;
                });
            }
        }
    }
}

